clear all
cd "~/Box Sync/Replication_AJPS_0215"
eststo clear
set more off
set mem 900m

use "Final_Analysis_YesPerc_Data.dta"
gen election_id = _n
xtset Dist_IRN election_id

merge m:1 Dist_IRN FY using "TtlDistrictVA_FY07toFY12.dta"

*Gain Score
label variable Gain "Gain Score"

*Table A10 Replication

tab FY, gen(Year_FE_)
eststo: xi: reg yes_percent AYP_Not_Met_2 Gain Year_FE_5-Year_FE_9, vce(cluster Dist_IRN)
estadd local Dist_FE "No"
estadd local Year_FE "Yes"
estadd local Ac_Desig "No"

*OLS District Covariates
eststo:  xi: reg yes_percent AYP_Not_Met_2 Year_FE_5-Year_FE_9 Gain Millage_Real Per_Pupil_Value Total_Expend Instruction_Expend PctEnrollBlack  PctEnrollHisp LEP_PctEnroll EconDisad_PctEnroll Disabled_PctEnroll Ln_Enroll2, vce(cluster Dist_IRN)
estadd local Dist_FE "No"
estadd local Year_FE "Yes"
estadd local Ac_Desig "No"


*OLS District Covariates with Mills, Private School, Own Housing (No Percentage Improvement)
eststo: xi: reg yes_percent AYP_Not_Met_2 Year_FE_5-Year_FE_9 Gain Millage_Real Per_Pupil_Value Total_Expend Instruction_Expend PctEnrollBlack  PctEnrollHisp LEP_PctEnroll EconDisad_PctEnroll Disabled_PctEnroll Ln_Enroll2 Mills household_privateenrollment_perc housing_own_percent, vce(cluster Dist_IRN)
estadd local Dist_FE "No"
estadd local Year_FE "Yes"
estadd local Ac_Desig "No"


*OLS District Covariates with Mills, Private School, Own Housing, Designation (No Percentage Improvement)
eststo: xi: reg yes_percent AYP_Not_Met_2 Gain Year_FE_5-Year_FE_9 Millage_Real Per_Pupil_Value Total_Expend Instruction_Expend PctEnrollBlack  PctEnrollHisp LEP_PctEnroll EconDisad_PctEnroll Disabled_PctEnroll Ln_Enroll2 Mills household_privateenrollment_perc housing_own_percent i.Designation, vce(cluster Dist_IRN)
estadd local Dist_FE "No"
estadd local Year_FE "Yes"
estadd local Ac_Desig "Yes"

*District Fixed Effects

eststo: xi: xtreg yes_percent AYP_Not_Met_2 Gain Year_FE_5-Year_FE_9 Millage_Real Per_Pupil_Value Total_Expend Instruction_Expend PctEnrollBlack  PctEnrollHisp LEP_PctEnroll EconDisad_PctEnroll Disabled_PctEnroll Ln_Enroll2 Mills i.Designation, fe vce(cluster Dist_IRN)

estadd local Dist_FE "Yes"
estadd local Year_FE "Yes"
estadd local Ac_Desig "Yes"

*esttab using Table_A10.tex, noconstant note("Heteroskedasticity robust standard errors clustered at the district level in parentheses")  label se star(* 0.05 ** 0.01 *** 0.001) r2 scalars("Year_FE Year Fixed Effects" "Dist_FE District Fixed Effects" "Ac_Desig Academic Designations")  title(OLS Models for Percent of Yes Votes) drop( Year_FE_5 Year_FE_6 Year_FE_7 Year_FE_8 Year_FE_9 _IDesignati_2 _IDesignati_3 _IDesignati_4 _IDesignati_5 _IDesignati_6 _cons) replace
eststo clear�
